<template>
    <div class="login_main">
        <div class="login_label">
            请登录
        </div>
        <div class="login_content">
            <el-form 
            :label-position="labelPosition" 
            label-width="80px" 
            :model="formLabelAlign">
                <el-form-item label="账号">
                    <el-input v-model="formLabelAlign.account"></el-input>
                </el-form-item>
                <el-form-item label="密码">
                    <el-input v-model="formLabelAlign.password"></el-input>
                </el-form-item>
                <el-button class="login_btn" @click="submit" type="primary">登录</el-button>
            </el-form>
        </div>
    </div>
    <div class="login_background" />
</template>


<script>
export default {
    data() {
        
        return {
            labelPosition: 'right',
            formLabelAlign: {
                account: '',
                password: '',
            }
        };
    },
    methods: {
        submit() {
            console.log("点击了");
            // 在Vue组件中
            this.$router.push('/main');
        }
    }
}

</script>

<style>

.el-form {
    margin-top: 40px;
    margin-right: 45px;
}

.login_btn {
    margin-top: 10px;
    margin-right: 20px;
    margin-left: 20px;
    margin-bottom: 20px;
    padding: 20px;
    width: 100%;
}

.login_content {
    border: 1px solid white;
    border-width: 3px;  
    border-radius: 5px;
}

.login_main {
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    height: 100vh;
    flex-direction: column
}

.login_background {
    position: fixed;
    /* 定位为固定位置 */
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: url('../assets/banner_login.jpg');
    background-size: cover;
    z-index: -1;
}

.login_label {
    padding: 20px;
    font-size: larger;
}

.el-form-item__label {
  color: white;
}

</style>